<template>
  <div>
    <button @click="reverse">Reverse</button>
    <p>{{ value }}</p>
  </div>
</template>

<script>
export default {
  name: 'MyComponent',
  props: ['value'],
  methods: {
    reverse() {
      const reversedValue = this.value.split('').reverse().join('')
      this.$emit('input', reversedValue)
    }
  }
}
</script>
